/**	
 * <br>
 * Copyright 2011 Chuan. All rights reserved.<br>
 * <br>			 
 * Package: com.chuan.mantu.utils <br>
 * FileName: ShareObj.java <br>
 * <br>
 * @version
 * @author javacyc@qq.com
 * @created 2012-11-16
 * @last Modified 
 * @history
 */

package com.chuan.mantu.utils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;

import com.chuan.mantu.vo.Pic;
import com.chuan.mantu.vo.PicRecord;

/**
 * {Enum ：单例共享对象}
 *  
 *  @author javacyc@qq.com
 *  @created 2012-11-16 下午04:01:34
 *  @lastModified       
 *  @history           
 */

public enum ShareObj {
	
	INSTANCE; //唯一实例
	
	/**
	 * 当前浏览的所有图片存放列表<br>
	 * key : 类别
	 * value : 当前类别下的图片列表
	 */
	private HashMap<String,LinkedList<ArrayList<Pic>>> picMap = new HashMap<String, LinkedList<ArrayList<Pic>>>();

	public HashMap<String, LinkedList<ArrayList<Pic>>> getPicMap() {
		return picMap;
	}
	
	/**
	 * 记录当前类别加载的图片信息
	 */
	private HashMap<String, PicRecord> picRecordMap = new HashMap<String, PicRecord>();

	public HashMap<String, PicRecord> getPicRecordMap() {
		return picRecordMap;
	}
	
	/**
	 * 记录当前类别下浏览的图片索引
	 */
	private HashMap<String, Integer> categoryIndexMap = new HashMap<String, Integer>();

	public HashMap<String, Integer> getCategoryIndexMap() {
		return categoryIndexMap;
	}  
	
	/**
	 * 
	 *  ｛返回当前类别的索引｝
	 *  @param category 类别
	 *  @return 索引
	 *  @author javacyc@qq.com
	 *  @created 2012-11-20 下午03:17:25
	 *  @lastModified       
	 *  @history
	 */
	public int getCategoryIndex(String category){
		return getCategoryIndexMap().get(category);
	}
	
	/**
	 * 
	 *  ｛设置当前类别的索引｝
	 *  @param category
	 *  @param index
	 *  @author javacyc@qq.com
	 *  @created 2012-11-20 下午03:29:53
	 *  @lastModified       
	 *  @history
	 */
	public void setCategoryIndex(String category ,int index){
		getCategoryIndexMap().put(category, index);
	}
	
	public String getCURRENTPICNAME() {
		return CURRENTPICNAME;
	}

	/**
	 * 
	 *  ｛设置当前浏览的图片名称<br>
	 *   return 类别/图片名称｝
	 *  @param category 类别
	 *  @param cURRENTPICNAME 名称
	 *  @author javacyc@qq.com
	 *  @created 2012-11-21 上午10:12:17
	 *  @lastModified       
	 *  @history
	 */
	public void setCURRENTPICNAME(String category ,String cURRENTPICNAME) {
		CURRENTPICNAME = category + Const.PATH_BACKLASH +cURRENTPICNAME;
	}

	/**
	 * 当前浏览图片名称<br>
	 * 例如：类别/图片名称<br>
	 */
	private String CURRENTPICNAME;
	
}